/**
 * 
 */
package cn.com.xf.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.com.xf.dao.TblOaFaqDAO;
import cn.com.xf.domain.TblOaFaq;
import cn.com.xf.service.FaqService;

/**
 * @author Administrator
 * 
 */
@Service
public class FaqServiceImpl implements FaqService {
	@Autowired
	private TblOaFaqDAO coreFaqDAO;

	@Override
	public List<TblOaFaq> select(int begin, int pageSize, String orderByField, String orderByMode, String faqClass) {
		// TODO Auto-generated method stub
		List<TblOaFaq> list = coreFaqDAO.selectAndOrder(begin, pageSize, orderByField, orderByMode, faqClass);
		return list;
	}

	@Override
	public int selectCount(String field, String value, String faqClass) {
		return coreFaqDAO.selectCount(field, value, faqClass);
	}

	@Override
	public int insert(TblOaFaq coreFaq) {
		coreFaqDAO.insert(coreFaq);
		return 0;
	}

	@Override
	public int update(TblOaFaq coreFaq) {
		
		return coreFaqDAO.updateByPrimaryKey(coreFaq);
	}

	@Override
	public TblOaFaq selectById(Integer faqId) {
		return coreFaqDAO.selectByPrimaryKey(faqId);
	}

	@Override
	public int selectFaqListCount(String faqClass, String faqQuestion,
			String publicMan, String createDateBegin, String createDateEnd) {
		return coreFaqDAO.selectFaqListCount(faqClass, faqQuestion, publicMan, createDateBegin, createDateEnd);
	}

	@Override
	public int deleteFaqById(Integer id) {
		// TODO Auto-generated method stub
		return coreFaqDAO.deleteByPrimaryKey(id);
	}

	@Override
	public List<TblOaFaq> select(int begin, int pageSize, String orderByField,
			String orderByMode, String faqClass, String faqQuestion,
			String publicMan, String createDateBegin, String createDateEnd) {
		return coreFaqDAO.selectFaqList(begin, pageSize, orderByField, orderByMode, faqClass, faqQuestion, publicMan, createDateBegin, createDateEnd);
	}


}
